<?php
    require_once dirname(dirname(__FILE__)) . '/config/config.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_general.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_LIBRARIES . 'lib_date.php';

    /**
     * Class api_about_us
     * @author Viet Anh
     */
    class api_about_us
    {
        public static function get_about_us()
        {
            $dao_general = new dao_general();

            $title   = $dao_general->get_option_value('about_us_title');
            $content = $dao_general->get_option_value('about_us_content');
            $date    = $dao_general->get_option_value('about_us_date');

            $about_us = array('title' => $title, 'content' => $content, 'date' => $date);

            return $about_us;
        }

        public static function set_about_us($title, $content)
        {
            $dao_general = new dao_general();

            $dao_general->set_option_value('about_us_title', $title);
            $dao_general->set_option_value('about_us_content', $content);
            $dao_general->set_option_value('about_us_date', lib_date::get_now());

            return TRUE;
        }
    }